<template>
	<view class="page" :style="themeColor">
		<view class="flex benben-position-layout flex flex-wrap align-center platformMessage_flex_0"
			:style="{height:(64+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
			<view class='flex flex-wrap align-center justify-between flex-sub platformMessage_fd0_0'>
				<view class='flex flex-wrap align-center platformMessage_fd0_0_c0'
					@tap.stop="handleJumpDiy" data-type="back" data-url="1">
					<text class='fu-iconfont2  platformMessage_fd0_0_c0_c0'>&#xE794;</text>
				</view>
				<view class='flex flex-wrap align-stretch justify-center'>
					<text class='platformMessage_fd0_0_c1_c0'>{{info.speechlist_title}}强化记录</text>
				</view>
				<view class='flex flex-wrap align-center platformMessage_fd0_0_c0'></view>
			</view>

		</view>
		<view :style="{height: (64+StatusBarRpx)+'rpx'}"></view>
		<view class="loading_css" v-if="isShow">
			<uv-loading-icon size="24" mode="circle" color="#4087FD" :show="true"></uv-loading-icon>
			<view>加载中</view>
		</view>

		<view class="flex flex-direction align-stretch benben-flex-layout platformMessage_flex_1" v-else>
			<view class="intensify">
				<view class="intensify_title">
					<view class="title_content" @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/index/antiForget/wordReinforcement?aid=${aid}&data_type=1&type=1`">{{info.create_time}}</view>
					<view class="title_operate">
						<!-- <view class="title_operate_1" @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/index/print/wordTwo?prinType=1&id=${aid}`">强化打印</view> -->
						<view class="title_operate_1" @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/index/antiForget/printWeek?aid=${aid}`">打印周</view>
						<!-- <view class="title_operate_2" v-if="info.is_strengthen == 2">强化中</view>
						<view class="title_operate_3" v-if="info.is_strengthen == 1">已完成</view> -->
						<view class="title_operate_2">本次训练记录</view>
					</view>
				</view>
				<view class="forget_list" v-if="info.is_strengthen == 2">
					<view class="forget_item" v-for="(v, k) in info.record" :key="k" :class="k == (info.record.length -1) ? 'no_line' : ''"  @tap.stop="goStrengthen(v.aid, v.status)">
						<view class="item_content">
							<text>{{v.day}}</text>
							<text class="qianghua" v-if="v.status == 2">未强化</text>
							<text class="qianghua_1" v-if="v.status == 3">待强化</text>
							<text class="qianghua_end" v-if="v.status == 1">已完成</text>
						</view>
					</view>
				</view>
			</view>
			
		</view>
		<view class="success" v-if="info.is_strengthen == 1">
			<image :src='STATIC_URL+"success.png"' mode="aspectFill"></image>
			<view>恭喜您，已完成强化</view>
		</view>

	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},


		data() {
			return {
				"aid": "",
				"info": {
					"record": []
				},
				"isShow": true,
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			let {
				aid,
				title
			} = options
			if (aid !== undefined) this.aid = aid
			
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.isShow = true;
			this.getRecord();
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		}, 
		methods: {
			// 获取记录 post656fe6a288460
			getRecord() {
				this.$api.post(global.apiUrls.post656fe6a288460, {
					aid: this.aid
				}).then(res => {
					// console.log(res);
					this.isShow = false;
					if (res.data.code == 1) {
						this.info = res.data.data;
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
			// 单词强化
			goStrengthen(aid, status) {
				if (status == 3) {
					this.$message.info('请在当日进行强化');
					return;
				}
				uni.navigateTo({
					url: '/pages/index/antiForget/wordReinforcement?aid=' + aid + '&data_type=1&type=2'
				})
			}
		}
	};
</script>
<style lang="scss" scoped>
	.intensify {
		margin: 15rpx 0 0;
		background: #fff;
		border-radius: 10rpx;
		.intensify_title {
			padding: 20rpx;
			border-bottom: 1px solid #eeeeee;
			display: flex;
			align-items: center;
			justify-content: space-between;
			font-size: 20rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			color: #333333;
			.title_content {
				flex: 1;
				font-size: 20rpx;
				font-weight: 500;
				display: -webkit-box;
				-webkit-box-orient: vertical;
				overflow: hidden;
				-webkit-line-clamp: 1;
			}
			.title_operate {
				display: flex;
				.title_operate_1 {
					width: 100rpx;
					height: 30rpx;
					line-height: 27rpx;
					text-align: center;
					background: #4087FD;
					border-radius: 15rpx;
					font-size: 15rpx;
					color: #fff;
				}
				.title_operate_2 {
					color: #4087FD;
					font-size: 18rpx;
					margin-left: 20rpx;
					font-weight: 500;
				}
				.title_operate_3 {
					color: #4DC777;
					font-size: 18rpx;
					margin-left: 20rpx;
					font-weight: 500;
				}
			}
		}
		.forget_list {
			padding: 0 20rpx;
			.forget_item {
				padding: 17rpx 0;
				border-bottom: 1px solid #eeeeee;
				.item_content {
					font-size: 18rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					color: #666666;
					line-height: 26rpx;
					display: flex;
					align-items: center;
					justify-content: space-between;
					.qianghua {
						color: #FA3B3D;
					}
					.qianghua_end {
						color: #4DC777;
					}
					.qianghua_1 {
						color: #999999;
					}
				}
			}
			.no_line {
				border-bottom: 1px solid transparent;
			}
		}
	}
	
	.content_img {
		width: 100%;
		height: 219rpx;
		margin-top: 20rpx;
		image {
			width: 100%;
			height: 100%;
			border-radius: 10rpx;
		}
	}
	.success {
		width: 100%;
		text-align: center;
		position: fixed;
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
	
		image {
			width: 156rpx;
			height: 113rpx;
		}
	
		view {
			font-size: 20rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			color: #101010;
			margin-top: 35rpx;
		}
	}
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: rgba(248, 248, 248, 1);
		background-size: 100% auto !important;
	}

	.platformMessage_flex_0 {
		background: #fff;
		width: 100%;
		height: 64rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.platformMessage_fd0_0_c1_c0 {
		font-size: 25rpx;
		font-weight: 500;
		color: #333333;
		line-height: 64rpx;
	}

	.platformMessage_fd0_0_c0_c0 {
		font-size: 25rpx;
		color: #333;
	}

	.platformMessage_fd0_0_c0 {
		width: 50rpx;
		height: 50rpx;
	}

	.platformMessage_fd0_0 {
		padding: 0rpx 25rpx 0rpx 25rpx;
	}

	.platformMessage_flex_1 {
		// margin: 16rpx 25rpx 16rpx 25rpx;
		// background: #fff;
		// border-radius: 10rpx;
		padding: 0 25rpx;
	}

	.platformMessage_fd1_0_c2 {
		font-size: 18rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		color: #999999;
		line-height: 25rpx;
	}

	.platformMessage_fd1_0_c1 {
		margin: 10rpx 0rpx 0rpx 0rpx;
		font-size: 18rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		color: #999999;
		line-height: 26rpx;
		// -webkit-line-clamp: 2;
		// overflow: hidden;
		// text-overflow: ellipsis;
		// display: -webkit-box;
		// -webkit-box-orient: vertical;
	}

	.platformMessage_fd1_0_c0 {
		font-size: 20rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		color: #333333;
		// line-height: 45rpx;
		// -webkit-line-clamp: 1;
		// overflow: hidden;
		// text-overflow: ellipsis;
		// display: -webkit-box;
		// -webkit-box-orient: vertical;
	}

	.platformMessage_fd1_0 {
		// background: #fff;
		width: 100%;
		padding: 20rpx 25rpx 20rpx 25rpx;
		border-bottom: 1px solid #eee;
	}
</style>